/*
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

#ifndef IPINPUTCONTROL_H
#define IPINPUTCONTROL_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>

namespace BurnDlg {

class IpInputControl : public QWidget {
    Q_OBJECT
public:
    explicit IpInputControl(QWidget *parent = nullptr);

    QString GetIP() const;
    void SetIP(const QString &ipNeedSet);
    QSize sizeHint() const override;
    QSize minimumSizeHint() const override;
    void Clear() const;

protected:
    bool eventFilter(QObject *watched, QEvent *event) override;
private slots:
    void SlotTextChanged(const QString& text);
private:
    void SetQFrame(const QString &bgColor);
    bool SetTextIpNameAlignSizePolTextChangeConnect(QLineEdit *textIp, const QString &name,
                                                    Qt::Alignment flag, QSizePolicy::Policy hor,
                                                    QSizePolicy::Policy ver);
    bool SetAllTextIpNameAlignSizePolTextChangeConnect();
private:
    QLabel *labDot1;
    QLabel *labDot2;
    QLabel *labDot3;

    QLineEdit *textIp1;
    QLineEdit *textIp2;
    QLineEdit *textIp3;
    QLineEdit *textIp4;

    QString ip;
};

}
#endif // IPINPUTCONTROL_H
